<?php

	class Smout{
		
		private $hclass = 'DskPage';
		
		private $handle;
		
		function set_handle($class){
			$this->hclass = $class;	
		}
		
		function get_handle(){
			if(!$this->handle){
				$hclass = $this->hclass;
				$this->handle = new $hclass();
			}
			return $this->handle;
		}
		
		function is_resource(){
			return !connection_aborted();	
		}
		
		function __call($method, $params){
			$handle = $this->get_handle();
			if(!is_callable(array($handle, $method))) trigger_error("smout: handle $this->hclass has no method '$method'", E_USER_ERROR);
			return call_user_func_array(array($handle, $method), $params);
		}

	}


